# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Angel Velasquez <angvp@archlinux.org>
# Contributor: Juergen Hoetzel <juergen@archlinux.org>

pkgname=menu-cache
pkgver=1.1.0
pkgrel=4
pkgdesc='Caching mechanism for freedesktop.org compliant menus'
arch=('loong64' 'x86_64')
license=('GPL2')
url='https://lxde.org/'
depends=('libfm-extra')
makedepends=('gtk-doc')
source=(https://downloads.sourceforge.net/lxde/$pkgname-$pkgver.tar.xz
        menu-cache-1.1.0-0001-Support-gcc10-compilation.patch)
sha256sums=('ed02eb459dcb398f69b9fa5bf4dd813020405afc84331115469cdf7be9273ec7'
            '393723ca805cb5ffb5eee2ad00a1c4624b513ca72bfb6a880d71907fb96e83de')

prepare() {
  cd $pkgname-$pkgver
  # Fix build (taken from Fedora)
  patch -Np1 -i ../menu-cache-1.1.0-0001-Support-gcc10-compilation.patch
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --sysconfdir=/etc \
    --libexecdir=/usr/lib \
    --enable-gtk-doc
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
